package com.dxt.springmvcdemo.config;

import com.dxt.springmvcdemo.interceptors.MyHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * BelongProject: springMVC
 * BelongPackage: com.dxt.springmvcdemo.config
 * Description:
 *
 * @Author 段鑫涛
 * @Create 2025/4/14 20:53
 * @Version 1.0
 */
@Component
public class MyHandlerInterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private MyHandlerInterceptor MyHandlerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(MyHandlerInterceptor) .addPathPatterns("/**");
    }
}
